/*******************************************************************************
** CopyRight (c) 2005-2008 SKY-MOBI Ltd. All rights reserved.
** Filename:  debug.h
** Creator:   yuzhifeng
** Version:   0.0
** Date:      
** Description:
 *******************************************************************************/
#ifndef __DEBUG_H__
#define __DEBUG_H__

#ifdef _EXT_RELEASE

#ifndef DISABLE_SGL_TRACE
#define DISABLE_SGL_TRACE
#endif

#ifndef DISABLE_SGL_DEBUG
#define DISABLE_SGL_DEBUG
#endif

#ifndef DISABLE_SGL_LOG
#define DISABLE_SGL_LOG
#endif

//#ifndef DISABLE_SGL_ASSERT
//#define DISABLE_SGL_ASSERT
//#endif

#ifdef ENABLE_TRACE_TO_FILE
#undef ENABLE_TRACE_TO_FILE
#endif
#endif


#ifndef DISABLE_SGL_TRACE
#define SGL_TRACE		mrc_printf
#ifdef SDK_MOD
	#define	QUICK_DBG	SGL_TRACE("enter FILE:%s @LINE: %d", __FILE__,__LINE__);
#else
	#define	QUICK_DBG	SGL_TRACE("enter %s, FILE:%s @LINE: %d", __func__, __FILE__,__LINE__);
#endif
#else
#define SGL_TRACE(...)  
#define	QUICK_DBG
#endif

#ifndef DISABLE_SGL_DEBUG
#define SGL_DEBUG		mrc_printf
#else
#define SGL_DEBUG(...)  
#endif

#ifndef DISABLE_SGL_WARNING
#define SGL_WARNING		mrc_printf
#else
#define SGL_WARNING(...)
#endif

#ifndef DISABLE_SGL_LOG
void sgl_log(const char* file, void* buffer, int size);
#define SGL_LOG(f, b, s)		sgl_log(f, b, s)
#else
#define SGL_LOG(f, b, s)
#endif

#ifndef DISABLE_SGL_ASSERT
void sgl_assert(const char* file, int line, int exp);		
#define SGL_ASSERT(exp)		sgl_assert(__FILE__, __LINE__, (int)(exp))
#else
#define SGL_ASSERT(exp)
#endif


#endif

